package mp

import (
	"duoke/model"
	"duoke/service"
	"duoke/utils/response"
	"github.com/gin-gonic/gin"
)

var Withdrawal = new(withdrawalCtl)

type withdrawalCtl struct{}

func (ctl *withdrawalCtl) List(c *gin.Context) {
	var req model.SearchWithdrawal
	if err := c.ShouldBind(&req); err != nil {
		response.Error(c, err.Error(), nil)
		return
	}
	list, err := service.Withdrawal.List(c, &req)
	if err != nil {
		response.Error(c, err.Error(), nil)
		return
	}
	response.Success(c, "获取成功", list)
	return
}
func (ctl *withdrawalCtl) Info(c *gin.Context) {
	var req model.SearchWithdrawal
	if err := c.ShouldBind(&req); err != nil {
		response.Error(c, err.Error(), nil)
		return
	}
	list, err := service.Withdrawal.WithdrawalLogInfo(c, &req)
	if err != nil {
		response.Error(c, err.Error(), nil)
		return
	}
	response.Success(c, "获取成功", list)
	return
}
